﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ERP_CargoExcel.aspx.cs" Inherits="CRM_Manager_ERP_CargoExcel" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>客户商品信息导入</title>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JavaScript/Common.js"></script>
    <script type="text/javascript" >
        function FileSelected() {
            Ext.net.DirectMethods.ImportExcel();
        }

        function SaveData() {
            var manageroomid = combox_Custom.getValue();
            if (manageroomid == "") {
                Ext.Msg.alert("系统提示", "请选择客户名称名称!");
                return;
            }
            Ext.net.DirectMethods.SaveData();
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
    <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
        <Content>
             <ext:Panel runat="server" Border="false" Layout="RowLayout">
                    <TopBar>
                        <ext:Toolbar runat="server">
                            <Items>
                                <ext:Button ID="extBtn_Refresh" runat="server" Text="刷新" Icon="ArrowRefresh">
                                    <Listeners>
                                        <Click Handler="gridPanel_listdata.reload();" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="extBtn_Add" runat="server" Icon="Accept" Text="保存上传" OnClientClick="SaveData();"  />
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Items>
                        <ext:Panel runat="server" Border="false" Padding="5" Height="67">
                            <Content>
                                <ext:FieldSet runat="server" Title="" Border="true" Padding="10" Layout="ColumnLayout" Header="true" Height="54">
                                    <Items>
                                        <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.5">
                                            <Items>
                                                <ext:ComboBox ID="combox_Custom" StyleSpec="width:70%" runat="server" FieldLabel="客户名称"   TabIndex="2"
                                                LabelStyle=" text-align:right; " Editable="false" ValueField="CustomerId" DisplayField="CustomerName">
                                                    <Store>
                                                        <ext:Store ID="Store_Custom" runat="server">
                                                            <Reader>
                                                                <ext:JsonReader IDProperty="CustomerId">
                                                                    <Fields>
                                                                        <ext:RecordField Name="CustomerId" />
                                                                        <ext:RecordField Name="CustomerName" />
                                                                    </Fields>
                                                                </ext:JsonReader>
                                                            </Reader>
                                                        </ext:Store>
                                                    </Store>
                                                </ext:ComboBox>
                                            </Items>
                                        </ext:Container>
                                         <ext:Container runat="server" Layout="FormLayout" LabelAlign="Left" ColumnWidth="0.5">
                                            <Items>
                                                <ext:FileUploadField ID="extFuf_ImportExcel" runat="server" ButtonOnly="true" ButtonText="从Excel导入" Icon="PageExcel" >
                                                    <Listeners>
                                                        <FileSelected Handler="Ext.net.DirectMethods.ImportExcel();" />
                                                    </Listeners>
                                                </ext:FileUploadField>
                                            </Items>
                                        </ext:Container>
                                    </Items>
                                </ext:FieldSet>
                            </Content>
                        </ext:Panel>
                        <ext:Panel runat="server" Border="false" RowHeight="1" Layout="FitLayout">
                            <Content>
                                <ext:GridPanel runat="server" ID="gridPanel_listdata" BodyStyle="border-width:1 0 0 0;" AutoScroll="true" TrackMouseOver="true" StripeRows="true" >
                                    <ColumnModel>
                                        <Columns>
                                            <ext:RowNumbererColumn Header="序号" Width="35" />
                                            <ext:Column Header="商品名称" DataIndex="CargoName" Width="100" />
                                            <ext:Column Header="规格" DataIndex="Spec" Width="120" />
                                            <ext:Column Header="型号" DataIndex="Version" Width="120" />
                                            <ext:Column Header="生产厂家" DataIndex="ProduceName" Width="100" />
                                            <ext:Column Header="产地" DataIndex="Area" />
                                            <ext:Column Header="单位" DataIndex="Unit" Width="100" />
                                            <ext:Column Header="进口国产" DataIndex="IsImported" Width="100" />
                                            <ext:Column Header="价格" DataIndex="Supplyprice" Width="100" />
                                            <ext:Column Header="客户码" DataIndex="Sos_No" Width="100" />
                                        </Columns>
                                    </ColumnModel>
                                    <Store>
                                        <ext:Store ID="store_listdata" runat="server" >
                                            <Reader>
                                                <ext:JsonReader IDProperty="RowNO" >
                                                    <Fields>
                                                        <ext:RecordField Name="RowNO" Type="Int" />
                                                        <ext:RecordField Name="CargoName" />
                                                        <ext:RecordField Name="Spec" />
                                                        <ext:RecordField Name="Version" />
                                                        <ext:RecordField Name="ProduceName" />
                                                        <ext:RecordField Name="Area" />
                                                        <ext:RecordField Name="Unit" />
                                                        <ext:RecordField Name="IsImported" />
                                                        <ext:RecordField Name="Supplyprice" />
                                                        <ext:RecordField Name="Sos_No" />
                                                    </Fields>
                                                </ext:JsonReader>
                                            </Reader>
                                        </ext:Store>
                                    </Store>
                                    <SelectionModel>
                                        <ext:RowSelectionModel runat="server" SingleSelect="true" />
                                    </SelectionModel>
                                </ext:GridPanel>
                            </Content>
                        </ext:Panel>
                    </Items>
                </ext:Panel>
        </Content>
    </ext:Viewport>
    </form>
</body>
</html>
